<div class="sidebar">
	<ul class="nav nav-pills nav-stacked">
		{{#each links}}
			<li><a href="{{href}}">{{name}}</a></li>
		{{/each links}}
	</ul>
</div>

<script>
	component.exports = {
		oncomplete: function () {
			this.findAll('a').forEach(function (a) {
				var $a = $(a);

				if (location.pathname.indexOf($a.attr('href')) === 0) {
					$a.addClass('active');
				} else {
					$a.removeClass('active');
				}
			});
		},
	};
</script>
